package cn.bgs.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户/管理员表
 * </p>
 *
 * @author cf
 * @since 2022-06-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="User对象", description="用户/管理员表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户id")
    private Integer userId;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "登录密码")
    private String passWord;

    @ApiModelProperty(value = "邮箱号")
    private String email;

    @ApiModelProperty(value = "住户编号")
    private String userNumber;

    @ApiModelProperty(value = "姓名")
    private String userName;

    @ApiModelProperty(value = "性别")
    private String sex;

    @ApiModelProperty(value = "身份证号")
    private String idCard;

    @ApiModelProperty(value = "与业主关系（本人、亲属、朋友、租户）")
    private String relationShip;

    @ApiModelProperty(value = "身份（业主、管理员） ")
    private String identity;

    @ApiModelProperty(value = "钱包余额")
    private Double balance;

    @DateTimeFormat(pattern = "yyyy-MM-dd ")//DateTimeFormat 是入参格式化；
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")//JsonFormat是出参格式化。
    @ApiModelProperty(value = "注册时间")
    private LocalDateTime registrationTime;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "住户来源（默认app注册）")
    private String residentSource;

    @DateTimeFormat(pattern = "yyyy-MM-dd ")//DateTimeFormat 是入参格式化；
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")//JsonFormat是出参格式化。
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd ")//DateTimeFormat 是入参格式化；
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")//JsonFormat是出参格式化。
    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "删除标志（y是删除 n是未删除）")
    private String deleteFlag;

    @ApiModelProperty(value = "带token值")
    @TableField(exist = false)
    private String token;

    @ApiModelProperty(value = "验证码")
    @TableField(exist = false)
    private String graphicVerifyCode;

}
